<?php
/**
 * Created by PhpStorm.
 * User: mr2longly <mr2longly@gmail.com>
 * Date: 8/10/16
 * Time: 23:09
 */

namespace Console\Controller;


use Think\Controller;
use Think\Log;

abstract class CronController extends Controller
{
    protected function _runLog($message, $level='') {
        $level = $level ?: 'Cron';
        $message = var_export($message, true);
        Log::write($message, $level, 'File', $this->_getLogFile());
    }

    private function _getLogFile() {
        return C('RUN_LOG_CRON_DIR') . date('Y-m-d') . '.log';
    }
}
